<title>添加商品</title>
<div class="layui-card">
  <form class="layui-form" lay-filter="add-goods-form">
    <blockquote class="layui-elem-quote">卖书订单</blockquote>
    <ul class="content-list">
    	<li>
    		<a lay-href="/sale-orders/not-send/" id="order_waitting_send_num"></a>
    		<p>待发货订单</p>
    	</li>
    	<li>
    		<a lay-href="/sale-orders/refunded/" id="yesterday_refund_num"></a>
    		<p>昨日退款订单</p>
    	</li>
    	<li>
    		<h3><span class="sp1" id="yesterday_order_num"></span></h3>
    		<p>昨日订单数</p>
    	</li>
    	<li>
    		<h3><span>￥</span><span class="sp1" id="yesterday_order_price"></span></h3>
    		<p>昨日订单金额</p>
    	</li>
    </ul>
    <ul class="content1">
    	<li>
    		<p class="p2">订单总数：<span class="sp1" id="total_order_num"></span></p>
    		<p class="p1">(微信支付 <span id="total_order_num_wechat"></span>单，余额支付 <span id="total_order_num_account"></span>单)</p>
    	</li>
    	<li>
    		<div class="line"></div>
    	</li>
    	<li>
    		<p class="p2">订单总金额：￥<span class="sp1" id="total_price"></span></p>
    		<p class="p1">(微信支付￥ <span id="total_price_wechat"></span>，余额支付 ￥<span id="total_price_account"></span>)</p>
    	</li>
    </ul>
    <div style="width: 100%;height: 10px;background: #f2eada;"></div>
    <blockquote class="layui-elem-quote">收书订单</blockquote>
    <ul class="content-list">
    	<li>
    		<a lay-href="/buy-orders/submited/" id="sell_order_submit_check_num"></a>
    		<p>已提交待审核</p>
    	</li>
    	<li>
    		<a lay-href="/buy-orders/platform/" id="sell_order_confirm_num"></a>
    		<p>待平台确认收货</p>
    	</li>
    	<li>
    		<h3><span class="sp1" id="yesterday_sell_order_num"></span></h3>
    		<p>昨日收书订单数</p>
    	</li>
    	<li>
    		<h3><span>￥</span><span class="sp1" id="yesterday_sell_order_cancel_num"></span></h3>
    		<p>昨日取消订单数</p>
    	</li>
    </ul>
    <ul class="content1">
    	<li>
    		<p style="margin-top: 48px;" class="p2">收书订单总数：<span class="sp1" id="total_sell_order_num"></span></p>
    	</li>
    	<li style="width: 2%;">
    		<div class="line"></div>
    	</li>
    	<li>
    		<p style="margin-top: 48px;" class="p2">审核完成订单总数：<span class="sp1" id="total_sell_order_check_num"></span></p>
    	</li>
    	<li style="width: 2%;">
    		<div class="line"></div>
    	</li>
    	<li>
    		<p style="margin-top: 48px;" class="p2">总打款金额：￥<span class="sp1" id="total_sell_order_price"></span></p>
    	</li>
    </ul>    
    <div style="width: 100%;height: 10px;background: #f2eada;"></div>
    <blockquote class="layui-elem-quote">拒收后申请退回订单</blockquote>
    <ul class="content-list">
    	<li>
    		<a lay-href="/return-order/order/" id="waitting_handle_back_order_num"></a>
    		<p>待退回订单</p>
    	</li>
    	<li>
    		<h3><span class="sp1" id="yesterday_apply_back_order_num"></span></h3>
    		<p>昨日待退回订单书数</p>
    	</li>
    	<li>
    		<h3><span class="sp1" id="total_back_order_num"></span></h3>
    		<p>退回订单总数</p>
    	</li>
    	<li>
    		<h3><span class="sp1" id="success_back_order_num"></span></h3>
    		<p>已退回订单总数</p>
    	</li>
    </ul>    
    <div style="width: 100%;height: 10px;background: #f2eada;"></div>
    <blockquote class="layui-elem-quote">用户的余额总览</blockquote>
    <ul class="content-list">
    	<li>
    		<h3><span class="sp1" id="yesterday_get_money_num"></span></h3>
    		<p>昨日提现人数</p>
    	</li>
    	<li>
    		<h3><span>￥</span><span class="sp1" id="yesterday_get_money"></span></h3>
    		<p>昨日提现金额</p>
    	</li>
    	<li>
    		<h3><span class="sp1" id="yesterday_get_money_error_num"></span></h3>
    		<p>昨日提现失败次数</p>
    	</li>
    	<li>
    		<h3><span class="sp1" id="total_get_money_error_num"></span></h3>
    		<p>提现失败总次数</p>
    	</li>
    </ul>
    <ul class="content1">
    	<li>
    		<p class="p2">当前可提现金额：￥<span class="sp1" id="money_total"></span></p>
    		<p class="p1">(当前 <span id="have_money_user_num"></span>人账户有余额)</p>
    	</li>
    	<li>
    		<p class="p2">累计提现总人数：<span class="sp1" id="total_get_money_num"></span></p>
    	</li>
    	<li>
    		<p class="p2">累计提现总额：￥<span class="sp1" id="total_money"></span></p>
    	</li>
    </ul>       
  </form>

<script>
    //Demo
  layui.use(['form'], function(){
    var form = layui.form;
    var $ = layui.$;
	  // 获取信息
    $.ajax({
		    type: "GET",
		    dataType: "json",
		    url: "https://bookshop.dingdangtoy.com/api/admin/index/index",
		    data: {},
		    headers: { //通过 request 头传递
	          'access-token': layui.data('layuiAdmin').access_token
	        },
			success: function(data){
                $('#order_waitting_send_num').text(data.data.book_order.order_waitting_send_num)
                $('#yesterday_refund_num').text(data.data.book_order.yesterday_refund_num)
                $('#yesterday_order_num').text(data.data.book_order.yesterday_order_num)
                $('#yesterday_order_price').text(data.data.book_order.yesterday_order_price)            
                $('#total_order_num').text(data.data.book_order.total_order_num)
                $('#total_order_num_wechat').text(data.data.book_order.total_order_num_wechat)
                $('#total_order_num_account').text(data.data.book_order.total_order_num_account)
                $('#total_price').text(data.data.book_order.total_price)
                $('#total_price_wechat').text(data.data.book_order.total_price_wechat)
                $('#total_price_account').text(data.data.book_order.total_price_account)
                
                $('#sell_order_submit_check_num').text(data.data.sell_order.sell_order_submit_check_num)
                $('#sell_order_confirm_num').text(data.data.sell_order.sell_order_confirm_num)
                $('#yesterday_sell_order_num').text(data.data.sell_order.yesterday_sell_order_num)
                $('#yesterday_sell_order_cancel_num').text(data.data.sell_order.yesterday_sell_order_cancel_num)
                $('#total_sell_order_num').text(data.data.sell_order.total_sell_order_num)
                $('#total_sell_order_check_num').text(data.data.sell_order.total_sell_order_check_num)
                $('#total_sell_order_price').text(data.data.sell_order.total_sell_order_price)
                
                $('#waitting_handle_back_order_num').text(data.data.back_order.waitting_handle_back_order_num)
                $('#yesterday_apply_back_order_num').text(data.data.back_order.yesterday_apply_back_order_num)
                $('#total_back_order_num').text(data.data.back_order.total_back_order_num)
                $('#success_back_order_num').text(data.data.back_order.success_back_order_num)
                
                $('#yesterday_get_money_num').text(data.data.user.yesterday_get_money_num)
                $('#yesterday_get_money').text(data.data.user.yesterday_get_money)
                $('#yesterday_get_money_error_num').text(data.data.user.yesterday_get_money_error_num)
                $('#total_get_money_error_num').text(data.data.user.total_get_money_error_num)
                $('#money_total').text(data.data.user.money_total)
                $('#have_money_user_num').text(data.data.user.have_money_user_num)
                $('#total_get_money_num').text(data.data.user.total_get_money_num)
                $('#total_money').text(data.data.user.total_money)
				form.render();
			},
			error: function(msg){
			  console.log(msg)
			}
		});
	
      form.render(null, 'add-goods-form')

	  // 跳转新增评论
	  $('#edit_comment').on('click', function(){
	  	location.hash = '/goods/add-goods/add-comment/book_id='+book_id;
	  	return false;
	  })
	  	  


  });
</script>
<style>
    .layui-elem-quote{background: #009688;color: #fff;}    	  
    .layui-form-label {text-align: center; width: 170px;}
    .content-list{width: 100%;height: 130px;clear: both;border-bottom: 1px solid #C2C2C2;}
    .content-list li{float: left;width: 25%;text-align: center;height: 130px;}
    .content-list li a{color: blue;margin-bottom: 10px;margin-top: 26px;font-size: 30px;display: block;}
    .content-list li h3{margin-bottom: 10px;margin-top: 26px;font-weight: normal;}
    .content1{width: 100%;height: 130px;clear: both;clear: both;}
    .content1 li{width: 30%;height: 130px;text-align: center;float: left;}
    .content1 li .line{width: 1px;border-left: 1px solid #C2C2C2;height: 80px;margin: 0 auto;margin-top: 24px;}
    .content1 li p{color: #333;}
    .sp1{font-size: 30px;}
    .content1 li .p1{color: #666;}
    .content1 li .p2{margin-bottom: 10px;margin-top: 30px;}
</style>